const vscode = require('vscode');
const getWorkspaceFolder = () => {
    let workspaceFolderFsPath = ''
    let workspaceFolderUri
    const editor = vscode.window.activeTextEditor;
    if (editor) {
        const currentDocumentUri = editor.document.uri;
        const selectedWorkspaceFolder = vscode.workspace.getWorkspaceFolder(currentDocumentUri)
        if (selectedWorkspaceFolder) {
            workspaceFolderUri = selectedWorkspaceFolder.uri
            workspaceFolderFsPath = workspaceFolderUri.fsPath
        }
    }
    return { workspaceFolderFsPath, workspaceFolderUri }
}

module.exports = getWorkspaceFolder;